package com.woniu.user.mqlistener;

import com.woniu.user.exception.WebException;
import com.woniu.user.exception.WebExceptionCode;
import com.woniu.user.service.NoticeService;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import javax.mail.MessagingException;

@Component
@RocketMQMessageListener(topic = "notice-topic", consumerGroup = "notoce-group")
public class NoticeListener implements RocketMQListener<String[]> {

    @Resource
    private NoticeService noticeService;

    @Override
    public void onMessage(String[] param) {
        noticeService.sendMail(param[0], param[1], param[2]);
    }
}
